package mvp.com.bbc.rcjavaretrofitdaggermvp.bean;


import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

import mvp.com.bbc.rcjavaretrofitdaggermvp.app.apiUrl.ApiUrl;

/**
 * Created by cbf on 2017/8/15.
 */

public class CommunityListBean {

    /**
     * art : [{"con":0,"icon":"http://xianximei.oss-cn-shenzhen.aliyuncs.com/xianximei/file/images/A495D882FBCA45B890F0BEC593A60CEB.png",
     * n":0,"articleid":118,"userid":43,"themeid":3,"nicename":"用户13924159881","pic":"http://xianximei.oss-cn-shenzhen.
     * aliyuncs.com/2017-08-24/123456/1503553149861.jpg,","content":"jjjjjj","isshow":"0","na":{"content":"0","icon":"0",
     * "nicename":"0"},"cl":0,"creattime":{"nanos":0,"time":1503553339000,"minutes":42,"seconds":19,"hours":13,"
     * month":7,"year":117,"timezoneOffset":-480,"day":4,"date":24},"ac":0},{"con":0,"icon":"http://xianximei.oss-cn-shenzhen.aliyuncs.c
     * om/xianximei/file/images/A495D882FBCA45B890F0BEC593A60CEB.png","ln":0,"articleid":117,"userid":43,"themeid":2,"nicename":
     * "用户13924159881","pic":"http://xianximei.oss-cn-shenzhen.aliyuncs.com/2017-08-24/123456/1503553149861.jpg,","content":
     * "jhhhhj","isshow":"0","na":{"content":"0","icon":"0","nicename":"0"},"cl":0,"creattime":{"nanos":0,"time":1503553118000,
     * "minutes":38,"seconds":38,"hours":13,"month":7,"year":117,"timezoneOffset":-480,"day":4,"date":24},"ac":0}]
     * totalPage : 0
     */

    private int totalPage;
    private List<ArtBean> art;

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public List<ArtBean> getArt() {
        return art;
    }

    public void setArt(List<ArtBean> art) {
        this.art = art;
    }

    public static class ArtBean {
        /**
         * con : 0
         * icon : http://xianximei.oss-cn-shenzhen.aliyuncs.com/xianximei/file/images/A495D882FBCA45B890F0BEC593A60CEB.png
         * ln : 0
         * articleid : 118
         * userid : 43
         * themeid : 3
         * nicename : 用户13924159881
         * pic : http://xianximei.oss-cn-shenzhen.aliyuncs.com/2017-08-24/123456/1503553149861.jpg,
         * content : jjjjjj
         * isshow : 0
         * na : {"content":"0","icon":"0","nicename":"0"}
         * cl : 0
         * creattime : {"nanos":0,"time":1503553339000,"minutes":42,"seconds":19,"hours":13,"month":7,"year":117,"timezoneOffset":-480,"day":4,"date":24}
         * ac : 0
         */

        private String con;
        private String icon;
        private String ln;
        private String articleid;
        private String userid;
        private String themeid;
        private String nicename;
        private String pic;
        private String content;
        private String isshow;
        private NaBean na;
        private String cl;
        private CreattimeBean creattime;
        private String ac;
        private String name; //"name": "豆腐干",
        private String width;
        private String height;

        public String getWidth() {
            return width;
        }

        public void setWidth(String width) {
            this.width = width;
        }

        public String getHeight() {
            return height;
        }

        public void setHeight(String height) {
            this.height = height;
        }

        public String getName() {
            if (name == null) return "";
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getCon() {
            return con;
        }

        public void setCon(String con) {
            this.con = con;
        }

        public String getIcon() {
            if (icon != null && icon.contains("http")) {
                return icon;
            } else {
                return ApiUrl.OSS_IMAGEHEADER + icon;
            }
        }

        public void setIcon(String icon) {
            this.icon = icon;
        }

        public String getLn() {
            if (ln == null) return "";
            return ln;
        }

        public void setLn(String ln) {
            this.ln = ln;
        }

        public String getArticleid() {
            return articleid;
        }

        public void setArticleid(String articleid) {
            this.articleid = articleid;
        }

        public String getUserid() {
            return userid;
        }

        public void setUserid(String userid) {
            this.userid = userid;
        }

        public String getThemeid() {
            return themeid;
        }

        public void setThemeid(String themeid) {
            this.themeid = themeid;
        }

        public String getNicename() {
            if (nicename == null) return "";
            return nicename;
        }

        public void setNicename(String nicename) {
            this.nicename = nicename;
        }

        public List<NinePicBean> getPic() {
            return getImageList();
        }

        public void setPic(String pic) {
            this.pic = pic;
        }

        public List<NinePicBean> getImageList() {
            List<NinePicBean> imgsList = new ArrayList();
            if (pic != null) {
                String[] imgs = pic.split(",");
                for (int i = 0; i < imgs.length; i++) {
                    NinePicBean ninePicBean = new NinePicBean();
                    if (pic.contains("http:")) {
                        ninePicBean.setUrl(imgs[i]);
                    } else {
                        ninePicBean.setUrl(ApiUrl.OSS_IMAGEHEADER + imgs[i]);
                    }
                    imgsList.add(ninePicBean);
                }
            }
            return imgsList;
        }

        public String getContent() {
            if (content == null) return "";
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public String getIsshow() {
            return isshow;
        }

        public void setIsshow(String isshow) {
            this.isshow = isshow;
        }

        public NaBean getNa() {
            return na;
        }

        public void setNa(NaBean na) {
            this.na = na;
        }

        public String getCl() {
            return cl;
        }

        public void setCl(String cl) {
            this.cl = cl;
        }

        public CreattimeBean getCreattime() {
            return creattime;
        }

        public void setCreattime(CreattimeBean creattime) {
            this.creattime = creattime;
        }

        public String getAc() {
            return ac;
        }

        public void setAc(String ac) {
            this.ac = ac;
        }

        public static class NaBean {
            /**
             * content : 0
             * icon : 0
             * nicename : 0
             */

            private String content;
            private String icon;
            private String niceName;

            public String getContent() {
                return content;
            }

            public void setContent(String content) {
                this.content = content;
            }

            public String getIcon() {
                return icon;
            }

            public void setIcon(String icon) {
                this.icon = icon;
            }

            public String getNiceName() {
                return niceName;
            }

            public void setNiceName(String niceName) {
                this.niceName = niceName;
            }
        }

        public static class CreattimeBean {
            /**
             * nanos : 0
             * time : 1503553339000
             * minutes : 42
             * seconds : 19
             * hours : 13
             * month : 7
             * year : 117
             * timezoneOffset : -480
             * day : 4
             * date : 24
             */

            private String nanos;
            private String time;
            private String minutes;
            private String seconds;
            private String hours;
            private String month;
            private String year;
            private String timezoneOffset;
            private String day;
            private String date;

            public String getNanos() {
                return nanos;
            }

            public void setNanos(String nanos) {
                this.nanos = nanos;
            }

            public String getTime() {
                if (time == null) return "";
                return time;
            }

            public void setTime(String time) {
                this.time = time;
            }

            public String getMinutes() {
                return minutes;
            }

            public void setMinutes(String minutes) {
                this.minutes = minutes;
            }

            public String getSeconds() {
                return seconds;
            }

            public void setSeconds(String seconds) {
                this.seconds = seconds;
            }

            public String getHours() {
                return hours;
            }

            public void setHours(String hours) {
                this.hours = hours;
            }

            public String getMonth() {
                return month;
            }

            public void setMonth(String month) {
                this.month = month;
            }

            public String getYear() {
                return year;
            }

            public void setYear(String year) {
                this.year = year;
            }

            public String getTimezoneOffset() {
                return timezoneOffset;
            }

            public void setTimezoneOffset(String timezoneOffset) {
                this.timezoneOffset = timezoneOffset;
            }

            public String getDay() {
                return day;
            }

            public void setDay(String day) {
                this.day = day;
            }

            public String getDate() {
                return date;
            }

            public void setDate(String date) {
                this.date = date;
            }
        }
    }
}
